package com.chasmcity.munrobagging.model;


import java.io.Serializable;

/**
 * TODO: Missing class description for Munro!
 * <p>
 * &copy; Copyright 2010 Kizoom Ltd.
 * <p>
 * $Id: wildebeest_standard.epf,v 1.9 2007/01/17 14:59:59 danf Exp $
 */
public class Munro implements Serializable {
	
	private String code;
	private MapReference mapReference;
	private Section section;
	private Type type;
	private int heightInMetres;
	private LatLong latLong;
	private String name;

	public String getCode() {
		return code;
	}
	
	public Type getType() {
		return type;
	}
	
	public void setType(Type type) {
		this.type = type;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	public MapReference getMapReference() {
		return mapReference;
	}
	
	public void setMapReference(MapReference mapReference) {
		this.mapReference = mapReference;
	}

	public Section getSection() {
		return section;
	}

	public void setSection(Section section) {
		this.section = section;
	}

	public int getHeightInMetres() {
		return heightInMetres;
	}
	
	public int getHeightInFeet() {
		return (int) (heightInMetres * 3.2808399);
	}

	public void setHeightInMetres(int heightInMetres) {
		this.heightInMetres = heightInMetres;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public LatLong getLatLong() {
		return latLong;
	}
	
	public void setLatLong(LatLong latLong) {
		this.latLong = latLong;
	}
	
	@Override
	public String toString() {
		return String.format("%s (%sm - %s)", getName(), getHeightInMetres(), getType());
	}
	
	@Override
	public int hashCode() {
		return getCode().hashCode();
	}
	
	@Override
	public boolean equals(Object obj) {
		return obj != null && obj.getClass() == getClass() && ((Munro)obj).getCode().equals(this.getCode());
	}
}
